
import axios from "axios";
import { BASE_URL } from './ApiCons'

export const saveAuthor = (name:string) =>{
    return axios.post(
        BASE_URL + '/author/save',
        {
            name
        }
    )
}

export const getByPage = (start:number,offset:number) => {
    return axios.get(
        BASE_URL + `/author/getByPage?start=${start}&offset=${offset}`
    )
}

export const getAll = () => {
    return axios.get(
        BASE_URL + `/author/getAll`
    )
}

export const countAuthor = () => {
    return axios.get(
        BASE_URL + '/author/count'
    )
}
export const findByName = (name:string) => {
    return axios.get(
        BASE_URL + `/author/findByName?name=${name}` 
    )
}